<?php
namespace folder1;
/////////////////////////////////////////////////////////////////////////////////
///////////////////////////Exception handling////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
class Class1
{
	public $age;
	public function __construct()
	{

	}
	public function setAge($age)
	{
		if(!isset($age))
		{
			throw new MyException("No Age Input!");
		}
		if(!is_int($age) || $age <= 0 || $age >= 100)
		{
			throw new \Exception("Age must be a natural number, greater than 0 and less than 100 !");
		}
		$this->age = $age;
	}
	public function getAge()
	{
		if(!isset($this->age))
		{
			throw new \Exception("The object has no age input!");
		}
		return $this->age;
	}
}
/////////////////////////////////////////////////////////////////////////////////